JQUERY AND JAVASCRIPT CODING EXERCISES: Coding For Beginners by TAM JJ

JQUERY AND JAVASCRIPT CODING EXERCISES: Coding For Beginners by TAM JJ

Author:TAM, JJ [TAM, JJ]
Language: eng
Format: epub
Published: 2020-11-15T00:00:00+00:00


Animate paragraph element

HTML CODE

<!DOCTYPE html>

<html>

<head>

<script src="https://code.jquery.com/jquery-git.js"></script>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width">

<title>Click the button to animate the paragraph element with a number of different properties.</title>

</head>

<body>

<p id="pid">jQuery</p>

<button id="button1">Click to see the animation</button>

</body>

</html>

CSS CODE

button {

display: block;

margin: 20px 0 0 0;

}

p {

background-color: #B0E0E6;

width: 70px;

border: 1px solid red;

}

JAVASCRIPT CODE

$('#button1').click(function(){

$( "#pid" ).animate({

width: "70%",

opacity: 0.4,

marginLeft: "0.6in",

fontSize: "3em",

borderWidth: "10px"

}, 1500 );

});



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.